/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author baikuam0
 */
public class DijkstraTest {

    public DijkstraTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    @Before
    public void setUp() {
        database.openBusDatabase();
    }

    @After
    public void tearDown() {
    }

    /**
     * Test of computeAllPaths method, of class Dijkstra.
     */
    @Test 
    public void testComputeAllPathsNormalInput() {
        
        System.out.println("computeAllPaths");
        HashMap<String, Location> graph = new HashMap();
        Location source = new Location(770);
        Calendar startTime = (Calendar) Calendar.getInstance();


        Dijkstra.computeAllPaths(graph, source, startTime);
      
    }
    @Test(expected = NullPointerException.class)
    public void testComputeAllPathsNullLocation() {
        System.out.println("computeAllPaths");
        HashMap<String, Location> graph = new HashMap();
        Location source = null;
        Calendar startTime =(Calendar) Calendar.getInstance();
        Dijkstra.computeAllPaths(graph, source, startTime);
        

    }

    @Test(expected = NullPointerException.class)
    public void testComputeAllPathsNullMap() {
        System.out.println("computeAllPaths");
        HashMap<String, Location> graph = null;
        Location source = new Location(770);
        Calendar startTime = (Calendar) Calendar.getInstance();
        Dijkstra.computeAllPaths(graph, source, startTime);
      

    }
    @Test(expected = NullPointerException.class)
       public void testComputeAllPathsNullStartTime() {
        System.out.println("computeAllPaths");
        HashMap<String, Location> graph = new HashMap();
        Location source = new Location(770);
        Calendar startTime = null;
        Dijkstra.computeAllPaths(graph, source, startTime);
        

    }
    @Test(expected = IllegalArgumentException.class)
     public void testComputeAllPathsInvalidLocation() {
        System.out.println("computeAllPaths");
        HashMap<String, Location> graph = new HashMap();
        Location source = new Location(1);
        Calendar startTime = (Calendar) Calendar.getInstance();
        Dijkstra.computeAllPaths(graph, source, startTime);

    }

    //TO DO
  /*  @Test(expected = IllegalArgumentException.class)
    public void testComputeAllPaths() {
        System.out.println("computeAllPaths");
        HashMap<String, Location> graph = new HashMap();
        Location source = new Location();
        Calendar startTime = (Calendar) Calendar.getInstance();
        Dijkstra.computeAllPaths(graph, source, startTime);
        // TODO review the generated test code and remove the default call to fail.

    }
*/
    /**
     * Test of getShortestPath method, of class Dijkstra.
     */
 /*  @Test //TO DO
    public void testGetShortestPath() {
        System.out.println("getShortestPath");
        Location target = new Location(800);
        ArrayList expResult =  new ArrayList<Location>();
        ArrayList result = Dijkstra.getShortestPath(target);
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
       
    }
*/
}